package dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import beans.Boliche;

public class BolicheDao {

    private static List<Boliche> boliche = null;

    public static List<Boliche> getBoliches() {
        if (boliche == null) {
            Session session = SimpleSessionFactory.getSessionFactory(null).openSession();
            session.beginTransaction();
            Query q = session.createQuery("from beans.Boliche");

            boliche = q.list();
            session.close();

        }
        return boliche;
    }
}
